//
//  SelectDealModel.m
//  Food choices
//
//  Created by xalo on 16/2/26.
//  Copyright © 2016年 张广斌. All rights reserved.
//

#import "SelectDealModel.h"
#import "DealModel.h"

@implementation SelectDealModel

-(void)setValue:(id)value forUndefinedKey:(NSString *)key
{

}

-(void)setValue:(id)value forKey:(NSString *)key
{
    [super setValue:value forKey:key];
    
    if ([key isEqualToString:@"deals"]) {
        NSArray *dealArray = value;
        
        for (NSDictionary *dict in dealArray) {
            DealModel *dealModel = [[DealModel alloc] init];
            
            [dealModel setValuesForKeysWithDictionary:dict];
            
            [self.deals addObject:dealModel];
        }
    }
    
}

-(NSMutableArray *)deals
{
    if (!_deals) {
        self.deals = [NSMutableArray array];
    }
    
    return _deals;
}

@end
